package com.hellobike.haxing.modules.order.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import com.hellobike.haxing.modules.order.entity.OrderAftersaleDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Description: 售后订单明细
 * @Author: haxing-boot
 * @Date:   2020-02-08
 * @Version: V1.0
 */
public interface OrderAftersaleDetailMapper extends BaseMapper<OrderAftersaleDetail> {
    /**
     * 查询售后订单明细
     * @param afterId
     * @return
     */
    @Select("select a.*,d.spu_code,d.product_type,d.dimension_values as \"dimensionValues\",d.sku_code,d.sku_image,d.biz_type,d.title from t_order_aftersale_detail a,t_order_detail d where a.order_detail_id=d.id and a.order_after_id=#{afterId}")
    List<OrderAftersaleDetail> queryDetailList(Long afterId);

    /**
     * 查询售后成功的明细
     * @param orderId
     * @return
     */
    @Select("select d.* from t_order_aftersale o,t_order_aftersale_detail d where o.id=d.order_after_id and o.after_status=15 and d.order_id=#{orderId}")
    List<OrderAftersaleDetail> queryDetailStatusSuccess(Long orderId);
}
